<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 对象的解构赋值
        // 1
        var obj1 = {str1:'Hello', str2:'World'};

        let {str1,str2} = {str1:'Hello', str2:'World'};


        // 2
        var obj2 = {a:'Hello', b:'World'};

        let {a,b} = {a:'Hello', b:'World'};

        
        // 3
        var obj3 = {a:['Hello'], b:'World'};

        let {a:[m],b} = {a:['Hello'], b:'World'};

        console.log(m);
        
        // 4
        var obj4 = {a:{c:'Hello'}, b:'World'};

        let {a:{c},b} = {a:{c:'Hello'}, b:'World'};

        console.log(c);
    </script>
</body>
</html>